package ewelinkapi

import (
	"context"

	"gitee.com/libs_2/ewelinkapi/model"
	"github.com/rs/zerolog/log"
)

// 通过socket查询4通道开关的状态信息
func (c *Client) Outlet4QueryStateBySocket(ctx context.Context, req model.QueryOutlet4Request) error {
	err := c.socket.conn.WriteJSON(req)
	if err != nil {
		return err
	}

	return nil
}

// 通过socket 变更4通道开关的状态
func (c *Client) Outlet4UpdateStateBySocket(ctx context.Context, req model.NotifyOutlet4Update) error {
	log.Info().Interface("params", req).Msg("Outlet4UpdateStateBySocket")
	err := c.socket.conn.WriteJSON(req)
	if err != nil {
		return err
	}

	return nil
}
